Optimal. Leaf size=89 \[ -\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{f}+\frac {3 a \cos (e+f x)}{f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \sqrt {a+a \sin (e+f x)}}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2795, 3060,
2852, 212} \begin {gather*} \frac {3 a \cos (e+f x)}{f \sqrt {a \sin (e+f x)+a}}-\frac {\cot (e+f x) \sqrt {a \sin (e+f x)+a}}{f}-\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a \sin (e+f x)+a}}\right )}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2795
Rule 2852
Rule 3060
Rubi steps
\begin {align*} \int \cot ^2(e+f x) \sqrt {a+a \sin (e+f x)} \, dx &=-\frac {\cot (e+f x) \sqrt {a+a \sin (e+f x)}}{f}+\frac {\int \csc (e+f x) \left (\frac {a}{2}-\frac {3}{2} a \sin (e+f x)\right ) \sqrt {a+a \sin (e+f x)} \, dx}{a}\\ &=\frac {3 a \cos (e+f x)}{f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \sqrt {a+a \sin (e+f x)}}{f}+\frac {1}{2} \int \csc (e+f x) \sqrt {a+a \sin (e+f x)} \, dx\\ &=\frac {3 a \cos (e+f x)}{f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \sqrt {a+a \sin (e+f x)}}{f}-\frac {a \text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{f}\\ &=-\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{f}+\frac {3 a \cos (e+f x)}{f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \sqrt {a+a \sin (e+f x)}}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(206\) vs. \(2(89)=178\).
time = 0.67, size = 206, normalized size = 2.31 \begin {gather*} \frac {\csc ^4\left (\frac {1}{2} (e+f x)\right ) \sqrt {a (1+\sin (e+f x))} \left (-4 \cos \left (\frac {1}{2} (e+f x)\right )+2 \cos \left (\frac {3}{2} (e+f x)\right )+4 \sin \left (\frac {1}{2} (e+f x)\right )-\log \left (1+\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin (e+f x)+\log \left (1-\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin (e+f x)+2 \sin \left (\frac {3}{2} (e+f x)\right )\right )}{f \left (1+\cot \left (\frac {1}{2} (e+f x)\right )\right ) \left (\csc \left (\frac {1}{4} (e+f x)\right )-\sec \left (\frac {1}{4} (e+f x)\right )\right ) \left (\csc \left (\frac {1}{4} (e+f x)\right )+\sec \left (\frac {1}{4} (e+f x)\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.00, size = 125, normalized size = 1.40
method | result | size |
default | \(\frac {\left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (\sin \left (f x +e \right ) \left (2 \sqrt {a -a \sin \left (f x +e \right )}\, a^{\frac {3}{2}}-\arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}}{\sqrt {a}}\right ) a^{2}\right )-\sqrt {a -a \sin \left (f x +e \right )}\, a^{\frac {3}{2}}\right )}{\sin \left (f x +e \right ) a^{\frac {3}{2}} \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) | \(125\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 306 vs.
\(2 (85) = 170\).
time = 0.39, size = 306, normalized size = 3.44 \begin {gather*} \frac {{\left (\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 1\right )} \sin \left (f x + e\right ) - 1\right )} \sqrt {a} \log \left (\frac {a \cos \left (f x + e\right )^{3} - 7 \, a \cos \left (f x + e\right )^{2} - 4 \, {\left (\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) + 3\right )} \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right ) - 3\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} - 9 \, a \cos \left (f x + e\right ) + {\left (a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) - a\right )} \sin \left (f x + e\right ) - a}{\cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right )^{2} - 1\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 1}\right ) - 4 \, {\left (2 \, \cos \left (f x + e\right )^{2} + {\left (2 \, \cos \left (f x + e\right ) + 3\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 3\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{4 \, {\left (f \cos \left (f x + e\right )^{2} - {\left (f \cos \left (f x + e\right ) + f\right )} \sin \left (f x + e\right ) - f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )} \cot ^{2}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.09, size = 157, normalized size = 1.76 \begin {gather*} -\frac {\sqrt {2} {\left (\sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}\right ) \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) + 8 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + \frac {4 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{2 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1}\right )} \sqrt {a}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {cot}\left (e+f\,x\right )}^2\,\sqrt {a+a\,\sin \left (e+f\,x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________